package com.gl.order.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gl.order.entity.TUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gl.order.entity.dto.UserPageDto;
import com.gl.order.entity.vo.UserAndRoleCodeVo;
import com.gl.order.entity.vo.UserPageVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author lsy
 * @since 2021-06-17
 */
@Repository
public interface TUserMapper extends BaseMapper<TUser> {

    List<UserAndRoleCodeVo> findByRoleCode(List<String> roleCodes);

    /**
     * 获取用户信息（分页）
     */
    IPage<UserPageVo> pageOfUser(Page<UserPageVo> page, UserPageDto dto);

    List<String> getRoles(@Param("userId") String userId);

}
